#ifndef MECH_VERSION_CLIENT_H
#define MECH_VERSION_CLIENT_H

#include "localTcpClient.h"
#include "CEvtVar.h"

typedef struct __mech_version_pose
{
    double p[6];
}MECH_VERSION_POSE;

class mech_version_client
{
public:
    mech_version_client();
    int init();
    int exe_project_get_pos(int num,MECH_VERSION_POSE pose,MECH_VERSION_POSE pos,std::vector<MECH_VERSION_POSE>& poses);

private:
    // 连接机械臂服务器
    localTcpClient version_client;
    int localPort = 50000;
    std::string localIP = "192.168.5.100";

    CEvtVar evtVar;
    char mData[2048] = {};
    int mDataLen = 0;
    int recv_data(char *buf, size_t buf_size);

    inline std::string get_cmd_101_str(int num,MECH_VERSION_POSE pose,MECH_VERSION_POSE pos);
    int parse_cmd_101_reply_str();

    inline std::string get_cmd_102_str(int num);
    int parse_cmd_102_reply_str(std::vector<MECH_VERSION_POSE>& poses);
};

#endif // MECH_VERSION_CLIENT_H
